package cn.tedu.es.service;

import cn.tedu.es.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * ElasticsearchRepository<Student, Long>
 *     泛型参数：
 *     1、操作的数据的类型: Student
 *     2、id的类型: Long
 *
 * 分页：
 * Pageable 封装分页的请求数据
 * Page 封装分页响应结果
 */
public interface StudentRepository extends ElasticsearchRepository<Student, Long> {
    List<Student> findByName(String key);

    Page<Student> findByNameOrBirthday(String name, String birthday, Pageable pageable);
}
